package ch4;


/**
 * @author ANG.YU
 * @date 2020-08-09 13:41
 */
public class Flower {
    private int petalCount = 0;
    private String s = "null";

    public Flower(int petals) {
        petalCount = petals;
        System.out.println("Constructor w/ int arg only, petalCount= "
                + petalCount);
    }

    Flower(String ss) {
        System.out.println("Constructor w/ String arg only, s=" + ss);
    }

    Flower(String s, int petals) {
        this(s);
        this.s = s;
        System.out.println("String & int args");
    }

    Flower() {
        this("hi, ", 47);
        System.out.println(
                "default constructor (no args)");
    }

    public static void main(String[] args) {
        Flower x = new Flower();
        x.print();
    }

    void print() {
        System.out.println(
                "petalCount = " + petalCount + " s = " + s);
    }
}
